<?php

class Controller_Account extends Controller_Website
{

    public function before() {
        parent::before();
        $this->section = 'account';
        $this->template->activeCat = 'account';
    }

	public function actionIndex()
	{
		$this->template->title = $this->settings['title'];
        if (!isset($_SESSION['identity'])){
            $this->response->redirect('/signin/');
        }
		$this->template->content = new View('account/index');
        $token = System::random('alphanuml', 4);
//        system::dump($token);exit();
	}
    public function actionOut()
    {
        {
            if (isset($_SESSION['identity'])) {
                unset($_SESSION['identity']);
            }
            session_regenerate_id(true);
        }
        $this->response->redirect('/account/');
    }

}